package flyweighgt_pattern.ex2;

/**
 * @author 申书航
 * @version 1.0
 */
public class InvisibilityPotion implements Potion {
    @Override
    public void drink(Alchemist alchemist) {
        alchemist.setVisibility(false);
        System.out.println("隐身药水已喝完，别人看不见你。");
        System.out.println(alchemist.getName() + System.identityHashCode(this));
    }

    @Override
    public void sell(int price) {
        System.out.println("隐身药水售价：" + price + " 元。");
    }
}
